//
//  BaseNavigationController.m
//  PgyHelper
//
//  Created by 鹏鹏 on 2020/11/26.
//  Copyright © 2020 CleverPeng. All rights reserved.
//

#import "BaseNavigationController.h"

@interface BaseNavigationController ()

@end

@implementation BaseNavigationController

+ (void)initialize {
    //appearance方法返回一个导航栏的外观对象
    //修改了这个外观对象，相当于修改了整个项目中的外观

    UINavigationBar *navBar = [UINavigationBar appearance];

    if (@available(iOS 13.0, *)) {
        UINavigationBarAppearance *appearence = [[UINavigationBarAppearance alloc] init];
        appearence.backgroundColor = [UIColor whiteColor];
        appearence.titleTextAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:17 weight:UIFontWeightBold]};

        appearence.shadowImage = nil;
        navBar.standardAppearance = appearence;
        navBar.scrollEdgeAppearance = appearence;
    } else {
        //背景颜色
        navBar.backgroundColor = [UIColor whiteColor];
        navBar.translucent = NO;
        //title文字属性
        navBar.titleTextAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:17 weight:UIFontWeightBold]};
    }
}

@end
